Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 2 - Geometric Shapes / Geometric Shapes Reference
Functions / Creating Geometric Shapes


GXNewPaths

You can use the GXNewPaths function to create a new path shape and initialize its geometry.

gxShape GXNewPaths(const gxPaths *data);
data
A pointer to the initial path geometry.
function result
A reference to the new path shape.
DESCRIPTION
The GXNewPaths function creates a copy of the default path shape, sets the owner count of the copy to 1, initializes its geometry with the values in the data parameter, and returns a reference to it as the function result. If you specify nil for the data parameter, this function returns a path shape with no path contours.

Although this function creates a copy of the default path shape, it does not create a copy of the default path shape's style, ink, or transform objects. The new path shape returned by this function contains references to same style, ink, and transform as the default path shape.

Implementation Limit
In version 1.0 of QuickDraw GX, the total size of a path geometry may not exceed 2,147,483,647 bytes. If the size of the data you provide in the data parameter exceeds this limit, the GXNewPaths function posts a size_of_path_exceeds_implementation_limit error.
SPECIAL CONSIDERATIONS
If no error occurs, the GXNewPaths function creates a shape; you are responsible for disposing of this shape when you no longer need it. See Inside Macintosh: QuickDraw GX Objects for information about creating and disposing of shapes.

If an error occurs, this function returns nil as the function result.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
number_of_points_exceeds_implementation_limit 
number_of_contours_exceeds_implementation_limit 
size_of_path_exceeds_implementation_limit 
count_is_less_than_one (debugging version)
SEE ALSO
For an example that uses this function, see "Creating and Drawing Paths" beginning on page 2-55.

For a discussion of paths and the default path shape, see "Path Shapes" beginning on page 2-25.

For a description of the gxPaths structure, see page 2-107.

To create a new path shape without specifying an initial geometry, see the description of the GXNewShape function in the chapter "Shape Objects" in Inside Macintosh: QuickDraw GX Objects.

To set the geometry of an existing path shape, see the description of the GXSetPaths function on page 2-133.

To draw a path geometry without creating a path shape, see the description of GXDrawPaths on page 2-162. To draw a path shape, see the description of GXDrawShape in the chapter "Shape Objects" in Inside Macintosh: QuickDraw GX Objects.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help